package response;

import java.io.IOException;

import core.Constants;
import core.GamePacket;

/**
 * Response class generated to return list of user's buddies,
 * when user makes such request.
 *
 * @author Zoran
 *
 */
public class ResponseBuddies extends GameResponse{

	// Buddies
	String buddies = "";

        public ResponseBuddies() {
            code = Constants.SMSG_BUDDIES;
        }
	/**
	 * Set buddies
	 *
	 * @param buddies buddies for the given user
	 */
	public void setBuddies(String buddies){
            this.buddies = buddies;
	}

        @Override
	public byte[] createResponse(){
    	GamePacket packet = new GamePacket(code);
        packet.addString(buddies);         // Add buddies

        return packet.getBytes();
    }
}